using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using UnityEngine;

namespace CalmNine.Framework
{

    /// <summary>
    /// 序列化工具
    /// </summary>
    public static class JsonUtil
    {
        /// <summary>
        /// 直接转化为自定义对象
        /// </summary>
        /// <typeparam name="T">对象泛型</typeparam>
        /// <param name="jsonStr">Json格式字符串</param>
        /// <returns></returns>
        public static T ConvertToObj<T>(string jsonStr)
        {
            return JsonConvert.DeserializeObject<T>(jsonStr);
        }

    }
}
